Strip Hermes debug info from production iOS bytecode#83256
Open
roryabraham wants to merge 5 commits intomainfrom
Open
Strip Hermes debug info from production iOS bytecode#83256roryabraham wants to merge 5 commits intomainfrom
roryabraham wants to merge 5 commits intomainfrom
Conversation
Add a patch for react-native's react-native-xcode.sh to always pass -output-source-map to hermesc for production builds. This strips ~13.4MB of debug metadata from the bytecode by writing it to the source map file instead. When source maps aren't being composed, the generated .map file is cleaned up to prevent it from shipping. This is the standalone App counterpart to the same fix applied in Mobile-Expensify for HybridApp builds. Co-authored-by: Cursor <cursoragent@cursor.com>
Made-with: Cursor
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
Contributor
Author
|
@truph01 I don't think we need C+ review here |
Julesssss
previously approved these changes
Feb 27, 2026
The previous patch broke debug builds on physical devices where EMIT_SOURCEMAP=true. The compose step expects main.jsbundle.map from hermesc, which wasn't being generated for dev builds. Now pass -output-source-map when EITHER source maps are requested (EMIT_SOURCEMAP=true) OR it's a production build (DEV!=true). Made-with: Cursor
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
51 tasks
Julesssss
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Patches
react-native-xcode.shto always pass-output-source-maptohermescfor production iOS builds, regardless of whetherSOURCEMAP_FILEis set. This strips ~10MB of debug metadata from the Hermes bytecode — the data gets written to a separate source map file instead of being embedded in the bytecode.Previously,
-output-source-mapwas only passed conditionally whenEMIT_SOURCEMAPwas true (derived fromSOURCEMAP_FILEbeing set). If the build environment didn't properly propagateSOURCEMAP_FILE, the flag was omitted and debug info remained in the shippedmain.jsbundle.When source maps are being composed (the normal case), the existing compose-and-cleanup flow is unchanged. When they aren't, the generated
.mapfile is cleaned up so it doesn't ship in the IPA.This is the standalone App build counterpart to the same fix applied in Mobile-Expensify for HybridApp builds: https://github.com/Expensify/Mobile-Expensify/pull/13867
Fixed Issues
$ #83000
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/13867
Tests
Offline tests
N/A — this change only affects the build-time bytecode compilation, not runtime behavior.
QA Steps
None.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A — build-time only change, no UI impact
Android: mWeb Chrome
N/A — build-time only change, no UI impact
iOS: Native
N/A — build-time only change, no UI impact
iOS: mWeb Safari
N/A — build-time only change, no UI impact
MacOS: Chrome / Safari
N/A — build-time only change, no UI impact